package com.dsjy.yf.address.service;

import com.dsjy.yf.address.entity.query.AdminDeleteQuery;
import com.dsjy.yf.address.entity.query.PageSearchQuery;
import com.dsjy.yf.address.entity.query.SearchQuery;

/**
 * @author whj
 * @version 1.0
 * @date 2021-01-20 9:03
 */
public interface CommonService {
    /**
     * 通过code与表名获取数据
     *
     * @param parentCode
     * @param tableName
     * @return
     */
    Object searchWithCode(Integer parentCode, String tableName);

    /**
     * 分页查询
     *
     * @param pageSearchQuery 页码、每页数量、表名
     * @param isAdmin
     * @return
     */
    Object searchWithPage(PageSearchQuery pageSearchQuery, Boolean isAdmin);

    /**
     * 条件查询
     *
     * @param searchQuery
     * @param isAdmin
     * @return
     */
    Object searchWithQuery(SearchQuery searchQuery, Boolean isAdmin);

    /**
     * 管理员删除审核
     *
     * @param query
     * @return
     */
    Integer deleteById(AdminDeleteQuery query);

    /**
     * 管理员删除审核
     *
     * @param tableName
     * @param id
     * @return
     */
    Integer deleteById(String tableName, Integer id);
}
